package com.spider.operator;

public class OperatorDemo1 {
    public static void main(String[] args) {
    //  理解关系运算符
    print(10,20);
    print1(10,20);
    print2(10,20,30);
    }
     public static void print(int a,int b) {

       System.out.println(a==b);
       System.out.println(a!=b);
       System.out.println(a>b);
       System.out.println(a<b);
       System.out.println(a>=b);
       System.out.println(a<=b);
     }
     // 构造理解三元运算符的方法
    public static void print1(int a,int b) {
        int c = a <= b ? a : b;
        System.out.println(c);

    }

    public static void print2(int a ,int b ,int c) {
        //需求：用三元运算符的嵌套打印出三个数中的最大值
        int max = a > b ?(a > c ? a : c):(b > c ? b : c);
        System.out.println(max);
    }


}
